package com.jbit.controller;


import com.jbit.common.RespBean;
import com.jbit.service.DepartmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author LiRenZhi
 * @since 2021-08-25
 */
@Api(tags = "部门模块")
@RestController
@RequestMapping("/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @ApiOperation(value = "获取所有部门及部门人数")
    @GetMapping("/")
    public RespBean getAllDepartment() {
        return RespBean.success().data("departments", departmentService.getAllDepartments());
    }
}

